package com.qd.common.panda.domain.entity.card.third.sync;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 第三方劵同步
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class ThirdPartySyncDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "事件不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "事件长度不能超过{max}位", groups = DefaultGroup.class)
    private String event;
    /**
     * 优惠金额
     */
    @NotNull(message = "优惠金额不能为空", groups = DefaultGroup.class)
    private BigDecimal discountAmount;
    /**
     * 优惠金额显示
     */
    private String discountAmountDisplay;
    /**
     * 券的总数量
     */
    private Long totalQuantity;
    /**
     * 已使用数量
     */
    private Long useQuantity;
    /**
     * 未使用数量
     */
    private Long unusedQuantity;
    /**
     * 同步时间
     */
    private LocalDateTime syncTime;
    /**
     * 第三方券商
     */
    @NotBlank(message = "第三方券商不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "第三方券商长度不能超过{max}位", groups = DefaultGroup.class)
    private String thirdParty;
    /**
     * 第三方券商显示
     */
    private String thirdPartyDisplay;
    /**
     * 操作人
     */
    @Size(max = 50, message = "操作人长度不能超过{max}位", groups = DefaultGroup.class)
    private String operator;
    /**
     * 操作人显示
     */
    private String operatorDisplay;
    /**
     * 机构ID
     */
    @Size(max = 50, message = "机构ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String orgId;
    /**
     * 机构ID显示
     */
    private String orgIdDisplay;

    @Override
    public void freeData() {
        this.event = null;
        this.discountAmount = null;
        this.discountAmountDisplay = null;
        this.totalQuantity = null;
        this.useQuantity = null;
        this.unusedQuantity = null;
        this.syncTime = null;
        this.thirdParty = null;
        this.thirdPartyDisplay = null;
        this.operator = null;
        this.operatorDisplay = null;
        this.orgId = null;
        this.orgIdDisplay = null;
        super.freeData();
    }
}
